<?php
	/** sous fonctionnalité d'affichage d'un matche
	 * @author Sebastian Mosser
	 */

class sfDisplayAMatche extends aSubFeature {


	public function __construct() {
		  $this->_acl = new AccessControlList(); 
      $this->_acl->setGranted(1); $this->_acl->setGranted(2);
      $this->_acl->setGranted(3); $this->_acl->setGranted(4);
      $this->_acl->setGranted(5); $this->_acl->setGranted(6);
      $this->_acl->setGranted(7);
		}



	protected function run() {
		
		$id = PropRetriever::getProp($_POST,"id");
		if ($id == "")
			$id = PropRetriever::getProp($_GET,"id");
	
		try {
			$aMatche = Matche::read($id);
			$ans = $aMatche->displayLong();
		}
		catch(Exception $e) {
			$ans  = "<h1> Une erreur est survenue ! </h1>";
			$ans .= "<div align=\"center\"> <span class=\"error\">";
			$ans .= "Ce matche n'existe pas !";
			$ans .= "</span></div>";
		}
		return $ans;
	}
	
}

?>